-
Notifications
You must be signed in to change notification settings - Fork 27
Conditionalize units which require a boot disk #102
Conversation
Updated to fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initial comments. will add some more tomorrow after testing artifacts
|
||
# Make sure if any ExecStart= fail, the boot fails. This normally would | ||
# already be guaranteed by `initrd.target` failing, but that doesn't seem to be | ||
# enough: https://bugzilla.redhat.com/show_bug.cgi?id=1696796 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried dropping the stanza from ignition-complete.target
, and that causes systemd to loop in the initrd if ignition-files fails. With the stanza, it properly fails the boot. So, still needed.
On the other hand, if a dependency of ignition-diskful.target
fails, systemd doesn't fail the boot with or without this stanza. 🙁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I recalled this working on f30. I guess systemd might've regressed on git master too? If that's the case, we should be able to file an issue upstream for this where it'll hopefully get more exposure. (The only reason I made it an RHBZ was that upstream only wants bugs that reproduce against N and N-1).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would definitely be nice if we could get this fixed in at least f31
@@ -0,0 +1,16 @@ | |||
# This target contains Ignition units that should only run when we have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've been trying to think of a better name than ignition-diskful.target
but I haven't come up with any clear winners. ignition-withbootdisk.target
was an initial thought but meh..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diskful
being the opposite of diskless
🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like ignition-bootloader.target
, diskful
doesn't quite convey the entire context that it's specifically for units targeting the boot disk.
I'd also be fine leaving it as is given the comments in the target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it doesn't. Those units aren't really related to the bootloader, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
others possibles: ignition-withharddisk.target
ignition-bootedfromdisk.target
blah blah blah :)
diskful
being the opposite ofdiskless
slightly_smiling_face
You know this might sound dumb, but putting that exact word in the description of this target unit file might actually help it click for people.
i.e. when we're not running diskless from a live image out of RAM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know this might sound dumb, but putting that exact word in the description of this target unit file might actually help it click for people.
Good point. Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM
@@ -0,0 +1,16 @@ | |||
# This target contains Ignition units that should only run when we have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like ignition-bootloader.target
, diskful
doesn't quite convey the entire context that it's specifically for units targeting the boot disk.
I'd also be fine leaving it as is given the comments in the target.
Add ignition-diskful.target, containing units that expect a writable boot disk. Enable it from the generator unless there's a command "is-live-image" which returns 0.
In live boots there's no /boot partition with a flag file to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I've written down this item as a followup:
- investigate need for https://bugzilla.redhat.com/show_bug.cgi?id=1696796 in ignition-diskful.target and ignition-complete.target - report issue upstream if not really fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
install_ignition_unit ignition-disks.service | ||
install_ignition_unit ignition-mount.service | ||
install_ignition_unit ignition-files.service | ||
install_ignition_unit ignition-remount-sysroot.service | ||
|
||
# units only started when we have a boot disk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if it'd be cleaner to have the units test ConditionPathExists=!/run/ostree-live
instead? I don't have a strong opinion though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these except ignition-remount-sysroot.service
pull in device dependencies, so they have to be enabled via generator. Conditions are only evaluated after dependencies are pulled in.
On live PXE or ISO boots, skip units which operate on a boot disk.
Part of coreos/fedora-coreos-config#155.